package controller;

import dao.OrderDao;
import dao.ProductMsgDao;
import pojo.order.OrderEntity;
import pojo.product.ProductMsgEntity;

import java.io.IOException;

/**
 * @author Limohan
 */
public class OrderController {
    private final OrderDao orderDao = new OrderDao();
    private static final OrderController orderController = new OrderController();
    private OrderController(){}

    public static OrderController getInstance(){
        return orderController;
    }

    //新增
    public String addMsg(OrderEntity orderEntity) throws IOException {
        orderEntity.setId("1");
        String id =orderDao.getMaxId();
        orderEntity.setId(id);
        orderDao.saveOrder(orderEntity);
        return "添加成功";
    }
}
